package com.wuge.controller;

import com.wuge.common.to.es.SkuEsModel;
import com.wuge.common.utils.R;
import com.wuge.service.ProductSaveService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
public class ProductUpController {
    @Autowired
    private ProductSaveService productSaveService;
@PostMapping("/sava/productList")
    public R saveSku(@RequestBody List<SkuEsModel> list) {
        boolean b = false;
        try {
            b = productSaveService.saveSku(list);
        } catch (Exception e) {
            e.printStackTrace();
        }
        if (b) {
            return R.ok();
        }
      else{
          return R.error(10001,"es更新商品出错");
        }
    }
}
